import { createElement } from "react"
import EnumRouter from "@/constants/EnumRouter";

export const systemRoutes: RouteConfig = {
    path: EnumRouter.systemSettingRoot,
    name: '系统设置',
    icon: createElement(require("@ant-design/icons").SettingOutlined),
    children: [
        {
            path: EnumRouter.user,
            name: "用户管理",
            icon: createElement(require("@ant-design/icons").UserOutlined),
            component: import("./pages/user")
        },
        {
            path: EnumRouter.role,
            name: "角色管理",
            icon: createElement(require("@ant-design/icons").UsergroupAddOutlined),
            component: import("./pages/role")
        },
        {
            path: EnumRouter.organization,
            name: "组织管理",
            icon: createElement(require("@ant-design/icons").GroupOutlined),
            component: import("./pages/organization")
        },
        {
            path: EnumRouter.menu,
            name: "菜单管理",
            icon: createElement(require("@ant-design/icons").MenuUnfoldOutlined),
            component: import("./pages/menu")
        },
        {
            path: EnumRouter.postjob,
            name: "岗位管理",
            icon: createElement(require("@ant-design/icons").IdcardOutlined),
            component: import("./pages/post")
        },
        {
            path: EnumRouter.logManage,
            name: '日志管理',
            icon: createElement(require("@ant-design/icons").FileTextOutlined),
            children: [
                {
                    path: EnumRouter.loginlog,
                    name: "登录日志",
                    icon: createElement(require("@ant-design/icons").FileTextOutlined),
                    component: import("./pages/log/LoginLog")
                },
                {
                    path: EnumRouter.operlog,
                    name: "操作日志",
                    icon: createElement(require("@ant-design/icons").FileTextOutlined),
                    component: import("./pages/log/OperatorLog")
                },
            ]
        },
        {
            path: EnumRouter.userPersonalSetting,
            name: "个人设置",
            icon: createElement(require("@ant-design/icons").SettingOutlined),
            component: import("./pages/userSetting")
        },
        {
            path: EnumRouter.account,
            name: "账户管理",
            icon: createElement(require("@ant-design/icons").HddOutlined),
            component: import("./pages/account")
        },
        {
            path: EnumRouter.dataDictionary,
            name: "数据字典",
            icon: createElement(require("@ant-design/icons").ProfileOutlined),
            component: import("./pages/dataDictionary")
        },
    ]
}


/**
 * 配置系统权限
 */
export const systemSettingPermission = {
    systemSettingRoot: {
        key: 'system'
    },
    user: {
        key: 'system:user:list',
        addButton: 'system:user:add',
        editButton: 'system:user:edit',
        removeButton: 'system:user:remove',
    },
    role: {
        key: 'system:role:list',
        addButton: 'system:role:add',
        editButton: 'system:role:edit',
        removeButton: 'system:role:remove',
    },
    organization: {
        key: 'system:dept:list',
        addButton: 'system:dept:add',
        editButton: 'system:dept:edit',
        removeButton: 'system:dept:remove',
    },
    postjob: {
        key: 'system:post:list',
        addButton: 'system:post:add',
        editButton: 'system:post:edit',
        removeButton: 'system:post:remove',
    },
    menu: {
        key: 'system:menu:list',
        addButton: 'system:menu:add',
        editButton: 'system:menu:edit',
        removeButton: 'system:menu:remove',
    },
    deviceBindAuth: {
        key: 'system:sensor:list',
        bindButton: 'system:sensor:bind',
        unbindButton: 'system:sensor:unbind',
    },
    logManage: {
        key: 'log',
    },
    loginlog: {
        key: 'system:logininfor:list',
        removeButton: 'system:logininfor:remove',
    },
    operlog: {
        key: 'system:operlog:list',
        removeButton: 'system:operlog:remove',
    },
    account: {
        key: "system:account:list",
    },
    dataDictionary: {
        key: "system:dict:list"
    },
}

